package demo02.demo2riji;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;

public class iterotar {
    public static void main(String[] args) {
     Collection<String>list=new ArrayList<>();
     list.add("1");
     list.add("2");
     Iterator<String>it=list.iterator();
     while (it.hasNext()){
         String s = it.next();
         System.out.print(s+" ");
     }


    }
}
